package com.ibp.entity;

/***
 * 主机实例
 * 
 * @author yf141
 * 
 */
public class HostMachine {

	private String ibmaAddress; // 注册代理地址
	private ServiceStatusEnum ibmaStatus; // 注册代理状态
	private String ibasAddress; // 通讯服务端地址
	private ServiceStatusEnum ibasStatus; // 通讯服务端状态

	public String getIbmaAddress() {
		return ibmaAddress;
	}

	public void setIbmaAddress(String ibmaAddress) {
		this.ibmaAddress = ibmaAddress;
	}

	public ServiceStatusEnum getIbmaStatus() {
		return ibmaStatus;
	}

	public void setIbmaStatus(ServiceStatusEnum ibmaStatus) {
		this.ibmaStatus = ibmaStatus;
	}

	public String getIbasAddress() {
		return ibasAddress;
	}

	public void setIbasAddress(String ibasAddress) {
		this.ibasAddress = ibasAddress;
	}

	public ServiceStatusEnum getIbasStatus() {
		return ibasStatus;
	}

	public void setIbasStatus(ServiceStatusEnum ibasStatus) {
		this.ibasStatus = ibasStatus;
	}
	// 当前主机状态
	public ServiceStatusEnum getHostMachineStatus() {
		if(ServiceStatusEnum.START.equals(ibmaStatus) && ServiceStatusEnum.START.equals(ibasStatus)){
			return ServiceStatusEnum.START ;
		}else if(ServiceStatusEnum.STOP.equals(ibmaStatus) && ServiceStatusEnum.STOP.equals(ibasStatus)){
			return ServiceStatusEnum.STOP ;
		}else{
			return ServiceStatusEnum.UNKNOWN ;
		}
	}

	@Override
	public String toString() {
		return "HostMachine [ibmaAddress=" + ibmaAddress + ", ibmaStatus="
				+ ibmaStatus + ", ibasAddress=" + ibasAddress + ", ibasStatus="
				+ ibasStatus + "]";
	}
	
}
